# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import os
#!pip install pytesseract
from PIL import Image
import pytesseract
# import easygui

def print_hi(name):


    # path = easygui.fileopenbox()  # 选择文件对话框
    text = pytesseract.image_to_string(Image.open(name), lang='chi_sim')  # 识别文字
    print(text)


    print(os.path.abspath(str(name)))

    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('D:\opencv-test\image.png')

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
